<style>
.itemsWrap{
  float:left;
  overflow:hidden;
}
</style>
<{capture name=titleImg}>
  <div class="titleImg"><a href="<{if $setting.titleImgHref}><{$setting.titleImgHref}><{else}><{link app=b2c ctl=site_gallery act=$setting.view arg0=$setting.id}><{/if}>"><img src="<{$setting.titleImgSrc}>" title="<{$setting.titleImgAlt}>"/></a></div>
<{/capture}>

<{capture name=goodsCat}>
  <{if $setting.showTitle=="on"}>
    <h4><{$setting.titleDesc}></h4>
  <{/if}>
<{/capture}>

<{assign var=defaultImage value=app::get('image')->getConf('image.set')}>
<{assign var=defaultImage value=$defaultImage['S']['default_image']}>

<{capture name=goodsLoop}>
    <{foreach from=$data.goods item=goods_data key=key name=goodslist}>

    <{capture name=goodsImg}>
    <{if $setting.showGoodsImg=="on"}>
    <div class="goodsImg" style="overflow:hidden;text-align:center;vertical-align: middle;<{if $setting.goodsImgWidth}>width:<{$setting.goodsImgWidth}>px;<{elseif $env.thumbnail_pic_width}>width:<{$env.thumbnail_pic_width}>px;<{/if}><{if $setting.goodsImgHeight}>height:<{$setting.goodsImgHeight}>px;<{elseif $env.thumbnail_pic_height}>height:<{$env.thumbnail_pic_height}>px;<{/if}>">
        <{if $setting.goodsImgWidth>0 && $setting.goodsImgHeight>0 }>
        <a href="<{link app=b2c ctl="site_product" act="index" arg0=$goods_data.goods_id}>" target="_blank" title="<{$goods_data.name}>">
            <img <{if $setting.restrict=='off'}><{if $setting.goodsImgWidth}>width="<{$setting.goodsImgWidth}>"<{/if}><{if $setting.goodsImgHeight}>height="<{$setting.goodsImgHeight}>"<{/if}><{/if}>  src="<{if $goods_data.udfimg == 'true'}><{$goods_data.thumbnail_pic|storager}><{elseif $goods_data.image_default_id}><{$goods_data.image_default_id|storager:'s'}><{else}><{$defaultImage|storager}><{/if}>" title="<{$goods_data.name}>">
        </a>
        <{else}>
        <a style='<{if $env.conf.b2c.site.thumbnail_pic_width !=0 && $env.conf.b2c.site.thumbnail_pic_height !=0}> width:<{$env.conf.b2c.site.thumbnail_pic_width}>px;height:<{$env.conf.b2c.site.thumbnail_pic_height}>px;<{/if}>' href="<{link app=b2c ctl="site_product" act="index" arg0=$goods_data.goods_id}>" target="_blank" title="<{$goods_data.name}>">
            <img style='<{if $env.conf.b2c.site.thumbnail_pic_width !=0 && $env.conf.b2c.site.thumbnail_pic_height !=0}> width:<{$env.conf.b2c.site.thumbnail_pic_width}>px;height:<{$env.conf.b2c.site.thumbnail_pic_height}>px;<{/if}>'
              src="<{if $goods_data.udfimg == 'true'}><{$goods_data.thumbnail_pic|storager}>
              <{elseif $goods_data.image_default_id}><{$goods_data.image_default_id|storager:'s'}>
              <{else}><{$defaultImage|storager}><{/if}>" title="<{$goods_data.name}>"
               alt="<{$goods_data.name|escape:html}>">
        </a>
        <{/if}>
    </div>
    <{/if}>
    <{/capture}>

    <{capture name=goodsName}>
      <{if $setting.showGoodsName=="on"}>
        <h6><a href="<{link app=b2c ctl="site_product" act="index" arg0=$goods_data.goods_id}>" target="_blank" title="<{$goods_data.name|escape:html}>"><{$goods_data.name|cut:$setting.max_length}></a></h6>
      <{/if}>
    <{/capture}>

    <{capture name=goodsDesc}>
      <{if $setting.showGoodsDesc=="on"}>
      <ul>
    <{assign var="savePC" value=$goods_data.mktprice-$goods_data.price}>

        <{if $setting.showGoodsMktPrice=="on"}>
        <li>
          <span class="mktprice0"><{$setting.mktPriceText|default:$___b2c='市场价'|t:'b2c'}><{if $setting.mktPriceSep > 0}><{$setting.mktPriceSep|cur_odr}><{/if}></span>
          <span class="mktprice1" style="color:<{$setting.color1}>;<{if $setting.mark_font == 'line-through'}>text-decoration:<{$setting.mark_font}>;<{elseif $setting.mark_font == 'bold'}>font-weight:<{$setting.mark_font}><{elseif $setting.mark_font == 'italic'}>font-style:<{$setting.mark_font}><{/if}>">
          <{$goods_data.mktprice|cur_odr}>
          </span>
        </li>
        <{/if}>
        <{if $setting.showGoodsPrice=="on"}>
        <li>
          <span class="price0"><{$setting.priceText|default:$___b2c='销售价'|t:'b2c'}><{if $setting.priceSep > 0}><{$setting.priceSep|cur_odr}><{/if}></span>
          <span class="price1" style="color:<{$setting.color2}>;<{if $setting.member_font == 'line-through'}>text-decoration:<{$setting.member_font}>;<{elseif $setting.member_font == 'bold'}>font-weight:<{$setting.member_font}><{elseif $setting.member_font == 'italic'}>font-style:<{$setting.member_font}><{/if}>">
          <{$goods_data.price|cur_odr}>
          </span>
        </li>
        <{/if}>
        <{if $setting.showMemberPrice=="on" && $goods_data.memprice}>
        <li>
          <span class="price0"><{$setting.mempriceText|default:$___b2c='会员价'|t:'b2c'}><{if $setting.mempriceSep > 0}><{$setting.mempriceSep|cur_odr}><{/if}></span>
          <span class="price1" style="color:<{$setting.color2}>;<{if $setting.smember_font == 'line-through'}>text-decoration:<{$setting.member_font}>;<{elseif $setting.smember_font == 'bold'}>font-weight:<{$setting.member_font}><{elseif $setting.smember_font == 'italic'}>font-style:<{$setting.smember_font}><{/if}>">
          <{$goods_data.memprice|cur_odr}>
          </span>
        </li>
        <{/if}>

        <{if $savePC>0 && $setting.showGoodsSave=="on"}>
        <li>
          <span class="save0"><{$setting.saveText|default:$___b2c='节省'|t:'b2c'}><{$setting.saveSep|default:''}></span>
          <span class="save1" style="color:<{$setting.color3}>;<{if $setting.save_font == 'line-through'}>text-decoration:<{$setting.save_font}>;<{elseif $setting.save_font == 'bold'}>font-weight:<{$setting.save_font}><{elseif $setting.save_font == 'italic'}>font-style:<{$setting.save_font}><{/if}>">
          <{$savePC|cur_odr}></span>
        </li>
        <{/if}>
        <{if $setting.showGoodsInfo=="on" && $goods_data.brief}>
        <li>
          <span class="info0"><{t app='b2c'}>简介：<{/t}><{$goods_data.brief}></span>
        </li>
        <{/if}>

        <{if $savePC>0 && $setting.showCount=="on"}>
        <li>
          <span class="countprice"><{$setting.countText|default:$___b2c='折扣'|t:'b2c'}></span>
          <span class="info1" style="color:<{$setting.color5}>;<{if $setting.count_font == 'line-through'}>text-decoration:<{$setting.count_font}>;<{elseif $setting.count_font == 'bold'}>font-weight:<{$setting.count_font}><{elseif $setting.count_font == 'italic'}>font-style:<{$setting.count_font}><{/if}>">
          <{if $goods_data.mktprice}>
              <{assign var="aCount" value=$goods_data.price/$goods_data.mktprice*100}>
          <{else}>
              <{assign var="aCount" value=0}>
          <{/if}>
          <{$aCount|number_format:2}>
          <{$setting.countSep|default:'%'}></span>
        </li>
        <{/if}>

      </ul>
            <{if $setting.showBuyArea=="on"}>
            <ul class="button">

        <{goodsmenu product=$goods_data}>
      </ul>
            <{/if}>
      <{/if}>
    <{/capture}>

      <div class="itemsWrap <{if $setting.column > 1 &&($smarty.foreach.goodslist.iteration % $setting.column|default:4) == 0}>last<{/if}>" product="<{$goods_data.goods_id}>" style="width:<{math equation="floor(99/x)" x=$setting.column|default:4}>%;">
        <div class="item">
          <{if $setting.showGoodsImg=="off"}>
            <{$smarty.capture.goodsName}>
            <{$smarty.capture.goodsDesc}>
          <{elseif $setting.showGoodsName=="off" && $setting.showGoodsDesc=="off"}>
            <{$smarty.capture.goodsImg}>
          <{elseif $setting.goodsImgPosition=="top"}>
            <{$smarty.capture.goodsImg}>
            <{$smarty.capture.goodsName}>
            <{$smarty.capture.goodsDesc}>
          <{elseif $setting.goodsImgPosition=="center"}>
            <{$smarty.capture.goodsName}>
            <{$smarty.capture.goodsImg}>
            <{$smarty.capture.goodsDesc}>
          <{elseif $setting.goodsImgPosition=="bottom"}>
            <{$smarty.capture.goodsName}>
            <{$smarty.capture.goodsDesc}>
            <{$smarty.capture.goodsImg}>
          <{elseif $setting.goodsImgPosition=="left"}>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
              <td><{$smarty.capture.goodsImg}></td>
              <td class="goodsDesc">
                <{$smarty.capture.goodsName}>
                <{$smarty.capture.goodsDesc}>
              </td>
              </tr>
            </table>
          <{elseif $setting.goodsImgPosition=="right"}>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                <td class="goodsDesc">
                  <{$smarty.capture.goodsName}>
                  <{$smarty.capture.goodsDesc}>
                </td>
                <td><{$smarty.capture.goodsImg}></td>
                </tr>
            </table>
          <{/if}>
        </div>
      </div>
      <{if $setting.column!=1 &&($smarty.foreach.goodslist.iteration % $setting.column|default:4) == 0}>
        <div class="clear"></div>
      <{/if}>
    <{/foreach}>
    <div class="clear"></div>
<{/capture}>

<div class="GoodsListWrap">
  <{if $setting.showTitleImg=="off"}>
    <div class="GoodsList">
      <{$smarty.capture.goodsCat}>
      <{$smarty.capture.goodsLoop}>
    </div>
  <{elseif $setting.titleImgPosition=="top"}>
    <{$smarty.capture.titleImg}>
    <div class="GoodsList">
      <{$smarty.capture.goodsCat}>
      <{$smarty.capture.goodsLoop}>
    </div>
  <{elseif $setting.titleImgPosition=="center"}>
    <{$smarty.capture.goodsCat}>
    <{$smarty.capture.titleImg}>
    <div class="GoodsList">
      <{$smarty.capture.goodsLoop}>
    </div>
  <{elseif $setting.titleImgPosition=="bottom"}>
    <div class="GoodsList">
      <{$smarty.capture.goodsCat}>
      <{$smarty.capture.goodsLoop}>
    </div>
    <{$smarty.capture.titleImg}>
  <{elseif $setting.titleImgPosition=="left"}>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
      <td width="<{$setting.titleImgWidth}>"><{$smarty.capture.titleImg}></td>
      <td><div class="GoodsList">
        <{$smarty.capture.goodsCat}>
        <{$smarty.capture.goodsLoop}>
      </div>
      </td>
      </tr>
    </table>
  <{elseif $setting.titleImgPosition=="right"}>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
      <td><div class="GoodsList">
        <{$smarty.capture.goodsCat}>
        <{$smarty.capture.goodsLoop}>
      </div>
      </td>
      <td width="<{$setting.titleImgWidth}>"><{$smarty.capture.titleImg}></td>
      </tr>
    </table>
  <{/if}>
  <{if $setting.showMore == "on" && $data.link}>

    <div class="more clearfix"><a href="<{$data.link}>"><{t app='b2c'}>更多...<{/t}></a></div>
  <{/if}>
</div>
